﻿@model EntryCodeElementViewModel

<div class="codeSnippetType">
	@Resources.CodeSnippet
	@{
		this.Html.RenderPartial("EditRemoveElement", this.Model.Order);
	
		string csChecked = this.Model.CodeType == CodeSnippetType.CSharp ? "checked=\"checked\"" : string.Empty;
		string sqlChecked = this.Model.CodeType == CodeSnippetType.SQL ? "checked=\"checked\"" : string.Empty;
		string jsChecked = this.Model.CodeType == CodeSnippetType.JS ? "checked=\"checked\"" : string.Empty;
		string htmlChecked = this.Model.CodeType == CodeSnippetType.XML ? "checked=\"checked\"" : string.Empty;
		string cssChecked = this.Model.CodeType == CodeSnippetType.CSS ? "checked=\"checked\"" : string.Empty;
	}

	<input type="radio" name="@string.Concat(Model.InputPrefix, "codeType")" @csChecked value="@CodeSnippetType.CSharp" />C#
	<input type="radio" name="@string.Concat(Model.InputPrefix, "codeType")" @sqlChecked value="@CodeSnippetType.SQL" />SQL
	<input type="radio" name="@string.Concat(Model.InputPrefix, "codeType")" @jsChecked value="@CodeSnippetType.JS" />JavaScript
	<input type="radio" name="@string.Concat(Model.InputPrefix, "codeType")" @htmlChecked value="@CodeSnippetType.XML" />XML/HTML
	<input type="radio" name="@string.Concat(Model.InputPrefix, "codeType")" @cssChecked value="@CodeSnippetType.CSS" />CSS
</div>
<div>
	<textarea rows="0" cols="0" name="@string.Concat(Model.InputPrefix, "code")" class="entryCode @(this.Model.IsCodeValid ? "" : "errorInput")">@this.Model.Code</textarea>
</div>
<div>
	@{ this.Html.RenderPartial("EditCommands", this.Model.Order); }
</div>

